<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>
            login
        </title>
        <script src="/js/jquery-2.2.3.min.js" type="text/javascript"></script>
        <script src="/js/jquery-ui.min.js" type="text/javascript"></script>
        <link type="text/css" href="/css/jquery-ui.min.css" rel="stylesheet">
        <link rel="stylesheet" href="../layui/css/layui.css"  media="all">
        <link href="/css/bootstrap.min.css" rel="stylesheet" type="text/css">
        <script src="/js/bootstrap.min.js" type="text/javascript"></script>
		<link type="text/css" href="/css/login3.css" rel="stylesheet">
        <script src="/js/login3.js" type="text/javascript"></script>
        <script type="application/javascript" src="../layui/layui.js"></script>
    </head>
    <body>
        <img src="/img/login_bg.jpg" class="bg">
        <div id="head" >
            <!--<img src="/img/loo.png" width="100%" height="auto">-->
            <div class="input-group" >

            </div>
        </div>
        <div id="center">





            <div class="forms">
                <form class="layui-form" method="post">
                    <div class="layui-form-item">
                        <label class="layui-form-label">用户名</label>
                        <div class="layui-input-block">
                            <input type="text" id="a_uname" name="a_uname" required  lay-verify="required" placeholder="请输入用户名" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">密&nbsp&nbsp&nbsp&nbsp码</label>
                        <div class="layui-input-block">
                            <input type="password" id="a_pword" name="a_pword" required lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input">
                            <span class="input-group-btn">
<!--						<img src="/img/eye_open.svg" id="passwordeye" alt="显/隐" onclick="show_hide_pwd('password')"/>-->
					</span>
                        </div>
                    </div>

                  <!--  <div data-v-0a99943a="" class="other clear">
                        <a data-v-0a99943a="" href="backPass.html" class="right forget">忘记密码？</a>
                    </div>-->
                    <div class="layui-form-item">

                        <button class="layui-btn" lay-submit lay-filter="formDemo">登录</button>
                        <!--<a href="register3.html">
                            <input class="btn btn-primary" name="registerButton" id="register" type="button" value="注册">
                        </a>-->
                    </div>

                </form>




           <!-- <form class="layui-form" name="myform" onsubmit="return validateform()" enctype="multipart/form-data"  method="post" id="myform">
                <div class="layui-form-item">
                    <span id="span_username">用户名：</span>
					<input class="form-control" id="a_uname" name="a_uname" type="text" value="" placeholder="只能输入字母或数字，4-16个字符" autocomplete="off">
                </div>
                <div class="layui-form-item">
                    <span id="span_password">密码：</span>
					<input class="form-control" id="a_pword" name="a_pword" type="password" value="" placeholder="密码长度6-12位" autocomplete="off">
					<span class="input-group-btn">
						<img src="/img/eye_open.svg" id="passwordeye" alt="显/隐" onclick="show_hide_pwd('password')"/>
					</span>
                </div>

                <div class="layui-form-item">
                    <button class="layui-btn" lay-submit lay-filter="formDemo">登录</button>
                    <a href="register3.html">
                        <input class="btn btn-primary" name="registerButton" id="register" type="button" value="注册">
                    </a>
                </div>
               &lt;!&ndash; <div id="btn_div">
                    <input class="btn btn-primary" name="loginButton" type="submit" id="login" value="登录"> 
					<a href="register3.html">
						<input class="btn btn-primary" name="registerButton" id="register" type="button" value="注册">
					</a>
                </div>&ndash;&gt;
            </form>-->
        </div>
        <div id="bottom">
            <div class="footer" style="color:white;">
                Copyright © 2013-2019 All Rights Reserved. 备案号：
            </div>
        </div>


        <script>
            //Demo
            layui.use('form', function(){
                var form = layui.form;

                //监听提交
                form.on('submit(formDemo)', function(dt){
                    var formData=dt.field;
                    $.ajax({
                        url:"/admin/login.do",
                        type:"post",
                        data:formData,
                        dataType:'json',
                        success:function(obj) {
                            console.log(obj.code);
                            //alert(obj.code);
                            if(obj.code == 0 && obj.data!=null) {
                                window.location.href="sys.html";
                            }else {
                                layer.alert("密码错误！");
                            }
                        },
                        error:function(){
                            layer.alert("ajax错误");
                        }
                    });
                    return false;

                });
            });
        </script>
    </body>
</html>